<div ng-controller="TemplateCtrl">
    <div class="row-fluid">
        <div class="span9">
            <div class="btn-toolbar server-btn-toolbar ui-toolbar">
                <button class="btn btn-danger btn-mini" ng-click="do_delete()">删除</button>
            </div>
        </div>
        <div class="span3">
            <span>每页显示</span>
            <select class="input-mini" ng-model="page_size" ng-options="pz for pz in page_sizes"
                    ng-change="change(page_size)">
            </select>
            <span>条</span>
        </div>
    </div>
    <div>
        <table class="table table-striped table-bordered table-condensed">
            <thead>
            <tr>
                <th><input type="checkbox" ng-model="selected_all"/></th>
                <th>模板名称</th>
                <th>操作系统</th>
                <th>大小</th>
                <th>存储</th>
                <th>创建时间</th>
                <th>实例个数</th>
                <th>状态</th>
            </tr>
            </thead>
            <tbody>
            <tr selectable="template" ng-repeat="template in templates|activeitem">
                <td><input type="checkbox" value="{{ template.id }}" ng-model="selected[template.id]"/></td>
                <td>{{ template.name }}</td>
                <td>
                    <img ng-src="/static/images/os16/os_{{ template.os_type |lowercase }}.png" alt="" class="img-size16"/>
                    {{ template.os_type }}
                </td>
                <td>{{ template.size |bytes}}</td>
                <td>{{ template.storage.name }}</td>
                <td>{{ template.created_at |date:'yyyy-MM-dd HH:mm:ss Z'}}</td>
                <td>{{ template.vdisk_set.length }}</td>
                <td><span class="label label-success">{{ template.status }}</span></td>
            </tr>
            </tbody>
        </table>
        <div class="pagination">
            <ul>
                <li ng-hide="should_hide()" ng-class="prev_class" ng-click="prev()"><a
                        href="javascript:void(0);">上一页</a></li>
                <li ng-repeat="i in [] | range:page_count()" ng-hide="should_hide()" ng-click="page(i)"
                    ng-class="(i == current_page) && 'active'">
                    <a href="javascript:void(0)">{{ i + 1}}</a>
                </li>
                <li ng-hide="should_hide()" ng-class="next_class" ng-click="next()"><a
                        href="javascript:void(0);">下一页</a></li>
            </ul>
        </div>

    </div>
</div>